/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package projeto_piu;

import java.awt.Container;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractButton;
import javax.swing.ButtonGroup;
import javax.swing.ButtonModel;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
import javax.swing.JSeparator;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;

/**
 *
 * @author LUANTAVARES
 */
//Parte 02
// Checkbox com 4 (quatro) opções
// Pelo menos 2 devem alterar algo na interface ou exibir mensagem de texto no prompt


public class Parte04 {
    
    private Container container;
    
    public Parte04(JFrame janela){
        container = janela.getContentPane();
        
    }
    
    public void executar(){
        this.addRadioButtons();
    }
    
    private void addRadioButtons(){
        final JButton jButton01 = new JButton();
        final JButton jButton02 = new JButton();
        final JButton jButton03 = new JButton();
        
        jButton01.setText("Primeiro Botao");
        jButton02.setText("");
        jButton02.setIcon(new ImageIcon(getClass().getResource("/projeto_piu_images/icone64.png")));
        jButton02.setSize(64, 64);
        jButton03.setText("Terceiro Botao");
        jButton03.setIcon(new ImageIcon(getClass().getResource("/projeto_piu_images/icone16.png")));
        
  
        ActionListener actionListener1 = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                
                JOptionPane.showMessageDialog(container, "Primeiro Botao Clicado");
            }
        };
        
ActionListener actionListener2 = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                JOptionPane.showMessageDialog(container, "Segundo Botao Clicado");
            }
        };

ActionListener actionListener3 = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent actionEvent) {
                JOptionPane.showMessageDialog(container, "Terceiro Botao Clicado");
            }
        };
        
        jButton01.addActionListener(actionListener1);
        jButton02.addActionListener(actionListener2);
        jButton03.addActionListener(actionListener3);
        
        JPanel pane5 = new JPanel(new FlowLayout(FlowLayout.LEFT));
       
        
        
        container.setLayout(new GridLayout(3, 4));
        
        
        pane5.add(jButton01);
        pane5.add(jButton02);
        pane5.add(jButton03);
        
        
        this.container.add(pane5);
        
    }
    
}
